﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ConsoleApp.Dapper
{
    public interface IRepository<T>
    {
        T GetById (int id);
        List<T> GetAll();
        void Add(T item);
    }

    public abstract class DBRepository<T> : IRepository<T>
    {
        protected IDbConnection _dbconn;

        public DBRepository(IDbConnection dbconn)
        {
            _dbconn = dbconn;
        }

        public abstract T GetById(int id);

        public abstract List<T> GetAll();

        public abstract void Add(T item);
    }
}